/*
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 1, or (at your option)
** any later version.

** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.

** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef __IA_STATS_MODEL_H__
#define __IA_STATS_MODEL_H__

#include <QAbstractTableModel>
#include <QObject>
#include <QModelIndex>
#include <QVariant>
#include <QStringList>
#include <QMap>

#include "ia_auth_c.h"

class IAStatsModel : public QAbstractTableModel {
    Q_OBJECT
    public:
        IAStatsModel(QObject * parent = 0);

        virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
        virtual int columnCount(const QModelIndex & parent = QModelIndex()) const;
        virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
        virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;

        void SetStats(const LOADSTAT & s);
        void SetDirNames(const QStringList & dn, const QMap<QString, int> & di);
        void SetUnits(int u) { units = u; };

        QString getFreeMb() const;
        QString getCash() const;

    private:
        LOADSTAT stat;
        QStringList dirNames;
        QMap<QString, int> dirIndex;
        int units;
};

#endif
